<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .box {
      width: 100px;
      height: 100px;
      background-color: red;
    }

    /* .abc-enter-active,
    .abc-leave-active {
      transition: opacity 0.5s ease;
    }

    .abc-enter-from,
    .abc-leave-to {
      opacity: 0;
    } */

    .abc-enter-active,
    .abc-leave-active {
      transition: all 0.5s ease;
    }

    .abc-enter-from {
      opacity: 0;
      transform: translateX(100%);
    }
    .abc-leave-to {
      opacity: 0;
      transform: translateX(-100%);
    }
  </style>
</head>
<body>
  <div id="app">
    <h2>Transition标签</h2>
    <button @click="show = !show">btn</button>

    <transition name="abc">
      <!-- <div class="box" v-if="show"></div> -->
       <box v-if="show"></box>
    </transition>
  </div>

  <script src="../vue3.js"></script>
  <script>
    const {createApp} = Vue;

    const Box = {
      template: `
        <div class="box"></div>
      `
    }

    const app = createApp({
      components: {
        Box
      },
      data() {
        return {
          show: true
        }
      }
    });

    app.mount("#app");
  </script>
</body>
</html>